package cn.signalpha.modules.shop.excel.converter;

import cn.signalpha.core.tool.utils.ObjectUtil;
import cn.signalpha.modules.shop.entity.enums.LogisticsTypeEnum;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * 类说明
 *
 * @author suguangjun
 */
public class LogisticsTypeConverter implements Converter<Integer> {

	@Override
	public Class supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
		return null;
	}

	@Override
	public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
		LogisticsTypeEnum orderPayTypeEnum = LogisticsTypeEnum.instance(integer);
		return new CellData(ObjectUtil.isNotEmpty(orderPayTypeEnum) ? orderPayTypeEnum.getName() : "");
	}
}
